package com.yihuier.yihuier.Mapper.RoomManager;

import com.yihuier.yihuier.Entity.RoomManager.AccessControl;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface AccessControlMapper {

    /**
     * 根据room_look参考的ac_id值获取门禁对象
     * */
    @Results({
            @Result(property = "ac_id" , column = "ac_id"),
            @Result(property = "ac_name" , column = "ac_name"),
            @Result(property = "ac_access_path" , column = "ac_access_path"),
            @Result(property = "ac_state" , column = "ac_state"),
            @Result(property = "ac_starttime" , column = "ac_starttime"),
            @Result(property = "ac_stoptime" , column = "ac_stoptime"),
            @Result(property = "ac_area" , column = "ac_area"),
            @Result(property = "ac_open_accesscontrol" , column = "ac_open_accesscontrol"),
    })
    @Select("SELECT ac_name,ac_access_path,ac_state,ac_starttime,ac_stoptime,ac_area,ac_open_accesscontrol from bz_accesscontrol where ac_id = #{room_lock};")
    AccessControl selectAccessControlObj(int rool_lock);
}
